package cn.sharp.bbs.service;

import org.springframework.web.servlet.mvc.method.annotation.SseEmitter;

/**
 * Key-value pair storage service. Using ehcache
 * @author zhao yu
 */
public interface CacheService {

    /**
     * Save the Mess SseEmitter to the cache
     * @param key key
     * @return the value we want to store
     */
    SseEmitter saveMessSseEmitter(Long key, SseEmitter sseEmitter);

    /**
     * search Mess SseEmitter in the cache
     * @param key key
     * @return null, if there is no Mess SseEmitter in the cache
     */
    SseEmitter findMessSseEmitter(Long key);

    /**
     * remove the Mess SseEmitter
     * @param key key
     */
    void clearMessSseEmitter(Long key);
}
